"use client";
import { ReactNode, useEffect, useState } from "react";
import "./globals.css";
import TitleBar from "@/components/TitleBar/TitleBar";
import { AntdRegistry } from "@ant-design/nextjs-registry";
import { AntdProvider } from "@/app/providers";
import ClientProvider from "./ClientProvider";

import "@ant-design/v5-patch-for-react-19";

// 定时任务初始化已移到startup.js中处理

interface AntdProviderProps {
  children: ReactNode;
  className?: string;
}

type Props = {
  children: ReactNode;
};

export default function RootLayout({ children }: Props) {
  const [isLogin, setIsLogin] = useState(false);
  
  return (
    <html lang="zh-CN">
      <body>
        <AntdRegistry>
          <AntdProvider>
            <ClientProvider>
              <div className=" flex flex-col min-h-screen  bg-gradient-to-r bg-[#0f1527] min-w-screen">
                <div className="h-[calc(100vh)]">{children}</div>
              </div>
            </ClientProvider>
          </AntdProvider>
        </AntdRegistry>
      </body>
    </html>
  );
}
